home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-07-17 | 43.1 KB | 1,512 lines |
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // jasperValues.mel
- //
-
- // ================= Values for each section =====================
- global string $jasperObjExpanded[];
- global int $jasperObjExpandedSize = 0;
-
- global proc jasperObjExpandedReset(
- string $jasperCommand,
- string $toolName,
- string $expand // true or false
- )
- {
- global string $jasperObjExpanded[];
- global int $jasperObjExpandedSize;
-
- $cmd = ($jasperCommand + " -q -ots " + $toolName);
- $jasperObjExpandedSize = `eval $cmd`;
-
- for( $i = 0; $i < $jasperObjExpandedSize; $i++ ) {
- $jasperObjExpanded[$i] = $expand;
- }
- }
-
-
- global proc jasperStampPressure(
- string $jasperCommand,
- int $enable
- )
- {
- radioButtonGrp -e -en $enable pressure0Radio;
- if( $enable == false )
- {
- radioButtonGrp -e -sl 1 pressure0Radio;
- string $cmd = $jasperCommand + "-e -pressure \"none\" `currentCtx`";
- eval $cmd;
- }
- }
-
- global proc jasperStampProfileValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- string $cmd;
- global int $jasperStampActive;
-
- // print ("jasperStampValues( " + $force + ") active = "
- // + $jasperStampActive + "\n");
-
- if ( !$force && $jasperStampActive ) {
- return;
- }
- $jasperStampActive = 1;
-
- // change radius field bounds, values and units label depending on
- // compensation mode
- //
- $cmd = ($jasperCommand + " -q -compensate " + $toolName);
- string $compensate = `eval $cmd`;
- $cmd = ($jasperCommand + " -q -lowerradius " + $toolName);
- float $lowerRadius = `eval $cmd`;
- $cmd = ($jasperCommand + " -q -radius " + $toolName);
- float $radius = `eval $cmd`;
- if ( $compensate == "none" ) {
- text -e -l "% of surf" lowerRadiusUnits;
- text -e -l "% of surf" radiusUnits;
- floatSliderGrp -e
- -max 50.0 -fmx 50.0 -v $lowerRadius
- lowerRadius;
- floatSliderGrp -e
- -max 50.0 -fmx 50.0 -v $radius
- radius;
- } else {
- text -e -l `currentUnit -q -l` lowerRadiusUnits;
- text -e -l `currentUnit -q -l` radiusUnits;
-
- global float $jasperBigFloat;
-
- floatSliderGrp -e
- -max 10.0 -fmx $jasperBigFloat -v $lowerRadius
- lowerRadius;
- floatSliderGrp -e
- -max 10.0 -fmx $jasperBigFloat -v $radius
- radius;
- }
-
- if ( ( $currentTool != "selectPaint" ) && ( $currentTool != "setEditPaint" ) ) {
-
- $cmd = ($jasperCommand + " -q -opacity " + $toolName);
- floatSliderGrp -e -v `eval $cmd` opacitySlider;
-
- if ($currentTool == "wtPaint" || $currentTool == "userPaint"
- || $currentTool == "attrPaint"
- || attrPaintInstCheckTool($currentTool) )
- {
- float $col[];
- $cmd = ($jasperCommand + " -q -color " + $toolName);
-
- $col = `eval $cmd`;
- floatSliderGrp -e -v $col[0] colorSlider;
- }
- }
-
- $cmd = ($jasperCommand + " -q -brushshape " + $toolName);
- string $shape = `eval $cmd`;
- if ( $shape == "circle1" ) {
- updateBrushShapeIcons -byCirclePoly;
- } else if ( $shape == "circle2" ) {
- updateBrushShapeIcons -byCircleGaus;
- } else if ( $shape == "circle3" ) {
- updateBrushShapeIcons -byCircleSolid;
- } else if ( $shape == "semiCircle1" ) {
- updateBrushShapeIcons -bySemiCirclePoly;
- } else if ( $shape == "semiCircle2" ) {
- updateBrushShapeIcons -bySemiCircleSolid;
- } else if ( $shape == "rectangle" ) {
- updateBrushShapeIcons -byRect;
- } else if ( $shape == "lineH" ) {
- updateBrushShapeIcons -byLineH;
- } else if ( $shape == "lineV" ) {
- updateBrushShapeIcons -byLineV;
- }
- }
-
-
- global proc jasperValueValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force,
- int $extendValue,
- string $extendValueValues
- )
- {
- string $cmd;
- global int $jasperWeightActive;
-
- // print ("jasperValueValues( " + $force + ") active = "
- // + $jasperWeightActive + "\n");
-
- if ( !$force && $jasperWeightActive ) return;
- $jasperWeightActive = 1;
-
- //
- // Stamp Profile frameLayout
- //
- jasperStampProfileValues( $jasperCommand, $toolName,
- $currentTool, $force
- );
-
- //
- // Operation frameLayout
- //
- $cmd = ($jasperCommand + " -q -edittype " + $toolName);
- string $operation = `eval $cmd`;
- if ( $operation == "absolute" ) {
- radioButtonGrp -e -sl 1 op0Radio;
- } else if ( $operation == "additive" ) {
- radioButtonGrp -e -sl 2 op0Radio;
- } else if ( $operation == "scale" ) {
- radioButtonGrp -e -sl 3 op0Radio;
- } else if ( $operation == "smooth" ) {
- radioButtonGrp -e -sl 4 op0Radio;
- }
-
-
- //
- // Weight Painting frameLayout
- //
- $cmd = ($jasperCommand + " -q -offset " + $toolName);
- floatSliderGrp -e -v `eval $cmd` ptOffset;
- $cmd = ($jasperCommand + " -q -mult " + $toolName);
- floatSliderGrp -e -v `eval $cmd` ptMult;
-
- $cmd = ($jasperCommand + " -q -clamplower " + $toolName);
- floatSliderGrp -e -v `eval $cmd` clLower;
- $cmd = ($jasperCommand + " -q -clampupper " + $toolName);
- floatSliderGrp -e -v `eval $cmd` clUpper;
-
- //
- // Clamping frameLayout
- //
- $cmd = ($jasperCommand + " -q -clamp " + $toolName);
- string $clamp = `eval $cmd`;
- if ( $clamp == "none" ) {
- radioButtonGrp -e -sl 1 clampRadio;
- } else if ( $clamp == "both" ) {
- radioButtonGrp -e -sl 2 clampRadio;
- } else if ( $clamp == "lower" ) {
- radioButtonGrp -e -sl 3 clampRadio;
- } else if ( $clamp == "upper" ) {
- radioButtonGrp -e -sl 4 clampRadio;
- }
-
- if( $extendValue )
- {
- string $cmd = $extendValueValues + " " + $jasperCommand + " "
- + $toolName + " " + $currentTool + " " + $force;
- eval $cmd;
- }
-
- if ( $currentTool == "wtPaint" ) {
- $cmd = ($jasperCommand + " -q -clusternames " + $toolName);
- string $clusterListStr = `eval $cmd`;
- string $clusters[];
- tokenize($clusterListStr, " ", $clusters);
-
- textScrollList -e -ra weightScrollList;
- for( $s in $clusters ) {
- textScrollList -e -append $s weightScrollList;
- }
- }
- }
-
-
- proc jasperStrokeValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- string $cmd;
- global int $jasperStrokeActive;
-
- // print ("jasperStrokeValues( " + $force + ") active = "
- // + $jasperStrokeActive + "\n");
-
- if ( !$force && $jasperStrokeActive ) return;
- $jasperStrokeActive = 1;
-
- //
- // Reflect Paint frameLayout
- //
- $cmd = ($jasperCommand + " -q -reflectpaint " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` reflectStrokeChkBox;
-
- $cmd = ($jasperCommand + " -q -reflectpainttype " + $toolName);
- string $operation = `eval $cmd`;
- if ( $operation == "reflectU" )
- {
- radioButtonGrp -e -sl 1 refPaint0Radio;
- }
- else if ( $operation == "reflectV" )
- {
- radioButtonGrp -e -sl 1 refPaint1Radio;
- }
- else if ( $currentTool != "paintColor" ) {
- if ( $operation == "reflectMult" ) {
- radioButtonGrp -e -sl 1 refPaint2Radio;
- }
- }
-
- $cmd = ($jasperCommand + " -q -reflectalongu " + $toolName);
- floatSliderGrp -e -v `eval $cmd` singleUSlider;
-
- $cmd = ($jasperCommand + " -q -reflectalongv " + $toolName);
- floatSliderGrp -e -v `eval $cmd` singleVSlider;
-
- if ( $currentTool == "putty" ) {
- $cmd = ($jasperCommand + " -q -invertrefvector " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` invertVectorChkBox;
- }
-
- //
- // Stylus Pressure frameLayout
- //
- $cmd = ($jasperCommand + " -q -pressure " + $toolName);
- string $pressure = `eval $cmd`;
- if ( $pressure == "none" ) {
- radioButtonGrp -e -sl 1 pressure0Radio;
- } else if ( $pressure == "opacity" ) {
- radioButtonGrp -e -sl 2 pressure0Radio;
- } else if ( $pressure == "radius" ) {
- radioButtonGrp -e -sl 3 pressure0Radio;
- } else if ( $pressure == "both" ) {
- radioButtonGrp -e -sl 4 pressure0Radio;
- }
-
- $cmd = ($jasperCommand + " -q -tabletexist " + $toolName);
- string $pressure = `eval $cmd`;
- if ( $pressure == true ) {
- jasperStampPressure( $jasperCommand, true );
- } else {
- jasperStampPressure( $jasperCommand, false );
- }
-
- //
- // Profile Alignment frameLayout
- //
- $cmd = ($jasperCommand + " -q -crt " + $toolName);
- $compensate = `eval $cmd`;
- if ( $compensate == "utangent" ) {
- radioButtonGrp -e -sl 1 compRef0Radio;
- } else if ( $compensate == "vtangent" ) {
- radioButtonGrp -e -sl 2 compRef0Radio;
- } else if ( $compensate == "upvector" ) {
- radioButtonGrp -e -sl 1 compRef1Radio;
- } else if ( $compensate == "pathvector" ) {
- radioButtonGrp -e -sl 2 compRef1Radio;
- }
- }
-
- global proc updateCommEdgeOneDisplayScreen(
- string $jasperCommand
- )
- {
- string $cmd;
-
- // update the text on common edge one display
- $cmd = ($jasperCommand + " -q -commedgerefname `currentCtx`");
- textFieldGrp -e -tx `eval $cmd` commEdgeRefPainterName;
-
- $cmd = ($jasperCommand + " -q -commedgerefedge `currentCtx`");
- textFieldGrp -e -tx `eval $cmd` commEdgeRefPainterEdge;
-
- $cmd = ($jasperCommand + " -q -commedgetarname `currentCtx`");
- textFieldGrp -e -tx `eval $cmd` commEdgeTarPainterName;
-
- $cmd = ($jasperCommand + " -q -commedgetaredge `currentCtx`");
- textFieldGrp -e -tx `eval $cmd` commEdgeTarPainterEdge;
- }
-
-
- global proc updateCommEdgeDisplayScreen(
- string $jasperCommand
- )
- {
- if( !`floatSliderGrp -q -ex commEdgesTol` ) return;
-
- string $cmd = ($jasperCommand + " -q -brushoperate `currentCtx`");
- string $type = `eval $cmd`;
- if ( $type == "paint" ) {
- // enable display mode
- floatSliderGrp -e -en true commEdgesTol;
- floatSliderGrp -e -en true commEdgesMinLength;
- floatSliderGrp -e -en true collapseCVTol;
- radioButtonGrp -e -en true commEdgesDisplay2;
- radioButtonGrp -e -en true commEdgesDisplay0;
- radioButtonGrp -e -en true commEdgesDisplay1;
- radioButtonGrp -e -en true commCornerDisplay0;
- radioButtonGrp -e -en true commCornerDisplay1;
-
- $cmd = ($jasperCommand + " -q -commedgedisplay `currentCtx`");
- string $display = `eval $cmd`;
- if ( $display == "one" ) {
- text -e -vis true commEdge1Text;
- text -e -vis true commEdge2Text;
- text -e -vis true commEdge3Text;
- text -e -vis true commEdge4Text;
- textFieldGrp -e -vis true commEdgeRefPainterName;
- textFieldGrp -e -vis true commEdgeRefPainterEdge;
- textFieldGrp -e -vis true commEdgeTarPainterName;
- textFieldGrp -e -vis true commEdgeTarPainterEdge;
- button -e -vis true commEdgeDisplayOneNext;
- button -e -vis true commEdgeDisplayOnePrev;
- } else {
- text -e -vis false commEdge1Text;
- text -e -vis false commEdge2Text;
- text -e -vis false commEdge3Text;
- text -e -vis false commEdge4Text;
- textFieldGrp -e -vis false commEdgeRefPainterName;
- textFieldGrp -e -vis false commEdgeRefPainterEdge;
- textFieldGrp -e -vis false commEdgeTarPainterName;
- textFieldGrp -e -vis false commEdgeTarPainterEdge;
- button -e -vis false commEdgeDisplayOneNext;
- button -e -vis false commEdgeDisplayOnePrev;
- }
- }
- else {
- floatSliderGrp -e -en false commEdgesTol;
- floatSliderGrp -e -en false commEdgesMinLength;
- floatSliderGrp -e -en false collapseCVTol;
-
- radioButtonGrp -e -en false commEdgesDisplay0;
- radioButtonGrp -e -en false commEdgesDisplay1;
- radioButtonGrp -e -en false commEdgesDisplay2;
-
- radioButtonGrp -e -en false commCornerDisplay0;
- radioButtonGrp -e -en false commCornerDisplay1;
-
- text -e -vis false commEdge1Text;
- text -e -vis false commEdge2Text;
- text -e -vis false commEdge3Text;
- text -e -vis false commEdge4Text;
-
- textFieldGrp -e -vis false commEdgeRefPainterName;
- textFieldGrp -e -vis false commEdgeRefPainterEdge;
- textFieldGrp -e -vis false commEdgeTarPainterName;
- textFieldGrp -e -vis false commEdgeTarPainterEdge;
- button -e -vis false commEdgeDisplayOneNext;
- button -e -vis false commEdgeDisplayOnePrev;
- }
- }
-
-
- proc jasperSeamValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- string $cmd;
- global int $jasperSeamActive;
-
- // print ("jasperSeamValues( " + $force + ") active = "
- // + $jasperSeamActive + "\n");
-
- if ( !$force && $jasperSeamActive ) return;
- $jasperSeamActive = 1;
-
- if ( $currentTool == "putty" || $currentTool == "wtPaint"
- || $currentTool == "userPaint" || $currentTool == "attrPaint"
- || attrPaintInstCheckTool($currentTool) )
- {
- //
- // Brush Mode frameLayout
- //
- $cmd = ($jasperCommand + " -q -brushoperate " + $toolName);
- string $type = `eval $cmd`;
- if ( $type == "paint" ) {
- radioButtonGrp -e -sl 1 brushOperationType;
- } else if ( $type == "selectedge" ) {
- radioButtonGrp -e -sl 2 brushOperationType;
- } else if ( $type == "selectcorner" ) {
- radioButtonGrp -e -sl 3 brushOperationType;
- }
-
- //
- // Seam AutoCreation frameLayout
- //
- $cmd = ($jasperCommand + " -q -commedgetol " + $toolName);
- floatSliderGrp -e -v `eval $cmd` commEdgesTol;
- text -e -l `currentUnit -q -l` commEdgesTolUnits;
-
- $cmd = ($jasperCommand + " -q -commedgeminlength " + $toolName);
- floatSliderGrp -e -v `eval $cmd` commEdgesMinLength;
- text -e -l `currentUnit -q -l` commEdgesMinLengthUnits;
-
- //
- // Common Edge/Corner frameLayout
- //
- $cmd = ($jasperCommand + " -q -commedgedisplay " + $toolName);
- string $type = `eval $cmd`;
- if ( $type == "off" ) {
- radioButtonGrp -e -sl 1 commEdgesDisplay0;
- } else if ( $type == "one" ) {
- radioButtonGrp -e -sl 1 commEdgesDisplay1;
- } else if ( $type == "all" ) {
- radioButtonGrp -e -sl 1 commEdgesDisplay2;
- }
-
- $cmd = ($jasperCommand + " -q -ccd " + $toolName);
- string $type = `eval $cmd`;
- if ( $type == "off" ) {
- radioButtonGrp -e -sl 1 commCornerDisplay0;
- } else if ( $type == "all" ) {
- radioButtonGrp -e -sl 1 commCornerDisplay1;
- }
-
- updateCommEdgeOneDisplayScreen( $jasperCommand );
- updateCommEdgeDisplayScreen( $jasperCommand );
- }
-
- $cmd = ($jasperCommand + " -q -collapsecvtol " + $toolName);
- floatSliderGrp -e -v `eval $cmd` collapseCVTol;
- text -e -l `currentUnit -q -l` collapseCVTolUnits;
-
- //
- // Stitching Mode frameLayout
- //
- if ( $currentTool == "putty" ) {
- $cmd = ($jasperCommand + " -q -stitchtype " + $toolName);
- string $type = `eval $cmd`;
- if ( $type == "off" ) {
- checkBoxGrp -e -en false stitchCornerChkBox;
- radioButtonGrp -e -sl 1 stitchTypeRadio;
- } else if ( $type == "pos" ) {
- checkBoxGrp -e -en true stitchCornerChkBox;
- radioButtonGrp -e -sl 2 stitchTypeRadio;
- } else if ( $type == "tan" ) {
- checkBoxGrp -e -en true stitchCornerChkBox;
- radioButtonGrp -e -sl 3 stitchTypeRadio;
- }
-
- $cmd = ($jasperCommand + " -q -stitchcorner " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` stitchCornerChkBox;
-
- $cmd = ($jasperCommand + " -q -polecv " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` stitchPoleCVChkBox;
- }
- //
- // Common Edge Value Averaging
- // - this is only displayed if we are in wtPaint or userPaint
- //
- else if ( $currentTool == "wtPaint" || $currentTool == "userPaint"
- || $currentTool == "attrPaint"
- || $currentTool == "attrPaintInst" )
- {
- $cmd = ($jasperCommand + " -q -averageedges " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` averageEdgeValues;
-
- $cmd = ($jasperCommand + " -q -averagepolecv " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` averagePoleCVValues;
- }
-
- updateSeamProperties( $jasperCommand );
- }
-
-
- proc jasperMaskValues(
- string $jasperCommand,
- string $toolName,
- int $force
- )
- {
- string $cmd;
- global int $jasperMaskActive;
-
- if ( !$force && $jasperMaskActive ) return;
- $jasperMaskActive = 1;
-
- //
- // CV Mask frameLayout
- //
- $cmd = ($jasperCommand + " -q -maskcv " + $toolName);
- string $type = `eval $cmd`;
- if ( $type == "off" ) {
- radioButtonGrp -e -sl 1 cvMaskType;
- } else if ( $type == "select" ) {
- radioButtonGrp -e -sl 2 cvMaskType;
- } else if ( $type == "unselect" ) {
- radioButtonGrp -e -sl 3 cvMaskType;
- }
-
- $cmd = ($jasperCommand + " -q -displaycv " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` cvMaskDisplay;
-
- $cmd = ($jasperCommand + " -q -maskcvenable " + $toolName);
- string $mask = `eval $cmd`;
-
- // grey out masking if masking is disabled
- if ( $mask == true ) {
- radioButtonGrp -e -en true cvMaskType;
- checkBoxGrp -e -en true cvMaskDisplay;
- }
- else {
- radioButtonGrp -e -en false cvMaskType;
- checkBoxGrp -e -en false cvMaskDisplay;
- }
- }
-
-
- proc jasperMapValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- string $cmd;
- global int $jasperMapActive;
-
- if ( !$force && $jasperMapActive ) return;
- $jasperMapActive = 1;
-
- string $attrToolName = "";
-
- //
- // Import Map frameLayout
- //
- $cmd = ($jasperCommand + " -q -importfilename " + $toolName);
- textFieldGrp -e -fileName `eval $cmd` importMapNameField;
-
- $cmd = ($jasperCommand + " -q -importreassign " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` reassignMapsChkBox;
-
- updateReloadButton( $jasperCommand );
-
- $cmd = ($jasperCommand + " -q -importfilemode " + $toolName);
- string $importMode= `eval $cmd`;
- if ( $importMode == "alpha" ) {
- radioButtonGrp -e -sl 1 importMapAlphaValueRadio1;
- } else if ( $importMode == "luminance" ) {
- radioButtonGrp -e -sl 2 importMapAlphaValueRadio1;
- } else if ( $importMode == "red" ) {
- radioButtonGrp -e -sl 1 importMapAlphaValueRadio2;
- } else if ( $importMode == "green" ) {
- radioButtonGrp -e -sl 2 importMapAlphaValueRadio2;
- } else if ( $importMode == "blue" ) {
- radioButtonGrp -e -sl 3 importMapAlphaValueRadio2;
- }
- if ( attrPaintInstCheckTool($currentTool) ) {
- string $name = eval("attrPaintCtx -q -bcn `currentCtx`");
- if ( $name == "polyClrVertPaint" ) {
- if ( $importMode == "rgb" ) {
- radioButtonGrp -e -sl 1 importMapAlphaValueRadio3;
- } else if ( $importMode == "rgba" ) {
- radioButtonGrp -e -sl 2 importMapAlphaValueRadio3;
- }
- }
- }
-
- if ( $currentTool == "selectPaint" ) {
- $cmd = ($jasperCommand + " -q -importthreshold " + $toolName);
- floatSliderGrp -e -v `eval $cmd` importSelectCVThresholdSlider;
- }
-
- //
- // Export Map frameLayout
- //
- if ( ( $currentTool == "wtPaint" ) ||
- ( $currentTool == "userPaint") ||
- ( $currentTool == "attrPaint") ||
- ( attrPaintInstCheckTool($currentTool) ) ||
- ( $currentTool == "selectPaint")
- )
- {
- $cmd = ($jasperCommand + " -q -exportfilename " + $toolName);
- textFieldGrp -e -fileName `eval $cmd` exportMapNameField;
-
- updateResaveButton( $jasperCommand );
-
- $cmd = ($jasperCommand + " -q -exportfilemode " + $toolName);
- string $exportVal = `eval $cmd`;
-
- if ( attrPaintInstCheckTool($currentTool) ) {
- $attrToolName = eval("attrPaintCtx -q -bcn `currentCtx`");
- }
- // if this is not 3d color paint tool (1d case)
- //
- if ( $attrToolName != "polyClrVertPaint" ) {
- if ( $exportVal == "alpha" ) {
- radioButtonGrp -e -sl 1 exportMapValueRadio1;
- } else if ( $exportVal == "luminance" ) { // same as rgb in 3d
- radioButtonGrp -e -sl 2 exportMapValueRadio1;
- } else if ( $exportVal == "rgb" ) { // same as luminance in 1d
- radioButtonGrp -e -sl 2 exportMapValueRadio1;
- } else if ( $exportVal == "rgba" ) { // same as luminance in 1d
- radioButtonGrp -e -sl 2 exportMapValueRadio1;
- }
- } else {
- if ( $exportVal == "alpha" ) {
- radioButtonGrp -e -sl 1 exportMapValueRadio2;
- } else if ( $exportVal == "luminance" ) { // same as rgb in 3d
- radioButtonGrp -e -sl 2 exportMapValueRadio2;
- } else if ( $exportVal == "rgb" ) { // same as luminance in 1d
- radioButtonGrp -e -sl 2 exportMapValueRadio2;
- } else if ( $exportVal == "rgba" ) { // same as luminance in 1d
- radioButtonGrp -e -sl 3 exportMapValueRadio2;
- }
- }
-
- $cmd = ($jasperCommand + " -q -exportfilesizex " + $toolName);
- intSliderGrp -e -v `eval $cmd` exportMapSizeXSlider;
-
- $cmd = ($jasperCommand + " -q -exportfilesizey " + $toolName);
- intSliderGrp -e -v `eval $cmd` exportMapSizeYSlider;
-
- $cmd = ($jasperCommand + " -q -exportfiletype " + $toolName);
- optionMenuGrp -e -v `eval $cmd` imageFormatOptionMenu;
- }
- }
-
- global proc updateReloadButton(
- string $jasperCommand
- )
- {
- string $fileName = eval("textFieldGrp -q -fileName importMapNameField");
-
- if ( $fileName != "" ) {
- button -e -en true importReloadButton;
- }
- else {
- button -e -en false importReloadButton;
- }
- }
-
- global proc updateResaveButton(
- string $jasperCommand
- )
- {
- string $fileName= eval("textFieldGrp -q -fileName exportMapNameField");
-
- if ( $fileName!= "" ) {
- button -e -en true exportReloadButton;
- }
- else {
- button -e -en false exportReloadButton;
- }
- }
-
-
- global proc adjustMapSizeSlider(
- string $jasperCommand,
- string $whichSlider
- )
- {
- float $ratio;
- if ( eval("checkBoxGrp -q -v1 exportKeepAspectChkBox") ) {
-
- $ratio = eval($jasperCommand + " -q -exportaspectratio `currentCtx`");
-
- if ( $whichSlider == "xSlider" ) {
- float $valX = eval("intSliderGrp -q -v exportMapSizeXSlider");
- float $newVal = $valX/$ratio;
- intSliderGrp -e -v $newVal exportMapSizeYSlider;
- eval($jasperCommand + " -e -exportfilesizey " + $newVal + " `currentCtx`");
- }
- else {
- float $valY = eval("intSliderGrp -q -v exportMapSizeYSlider");
- float $newVal = $valY*$ratio;
- intSliderGrp -e -v $newVal exportMapSizeXSlider;
- eval($jasperCommand + " -e -exportfilesizex " + $newVal + " `currentCtx`");
- }
- }
- }
-
- global proc setAspectRatio(
- string $jasperCommand
- )
- {
- if ( eval("checkBoxGrp -q -v1 exportKeepAspectChkBox") ) {
-
- float $valX = eval("intSliderGrp -q -v exportMapSizeXSlider");
- float $valY = eval("intSliderGrp -q -v exportMapSizeYSlider");
-
- // calculate the aspect ratio
- float $ratio = $valX/$valY;
-
- // set the aspect ratio in jasper
- eval($jasperCommand + " -e -exportaspectratio " + $ratio + " `currentCtx`");
- }
- }
-
-
- proc jasperDisplayValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- string $cmd;
- global int $jasperDisplayActive;
-
- // print ("jasperDisplayValues( " + $force + ") active = "
- // + $jasperDisplayActive + "\n");
-
- if ( !$force && $jasperDisplayActive ) {
- return;
- }
- $jasperDisplayActive = 1;
-
- //
- // Surface frameLayout
- //
- $cmd = ($jasperCommand + " -q -outline " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` drawOutlineChkBox;
-
- $cmd = ($jasperCommand + " -q -brushfeedback " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` brushFeedbackChkBox;
-
- $cmd = ($jasperCommand + " -q -outlinepaint " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` drawOutlinePaintingChkBox;
-
- $cmd = ($jasperCommand + " -q -outlinepaint " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` drawOutlinePaintingChkBox;
-
- $cmd = ($jasperCommand + " -q -showactive " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` showActiveLinesChkBox;
-
- // call a new global function for setting the brush feedback
- updateBrushFeedback( $jasperCommand );
-
-
- //
- // Color feedback frameLayout
- //
- if (( $currentTool == "wtPaint" ) || ( $currentTool == "userPaint")
- || $currentTool == "attrPaint"
- || ( $currentTool == "attrPaintInst"))
- {
- $cmd = ($jasperCommand + " -q -colorfeedback " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` colorFeedbackChkBox;
- $cmd = ($jasperCommand + " -q -disablelighting " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` disableLightingChkBox;
- if ( $currentTool == "wtPaint" ) {
- $cmd = ($jasperCommand + " -q -usesetcolor " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` useSetColorChkBox;
- }
- $cmd = ($jasperCommand + " -q -colorrangelower " + $toolName);
- floatSliderGrp -e -v `eval $cmd` crLower;
- $cmd = ($jasperCommand + " -q -colorrangeupper " + $toolName);
- floatSliderGrp -e -v `eval $cmd` crUpper;
- }
-
- if ( $currentTool == "setEditPaint" ) {
- $cmd = ($jasperCommand + " -q -setcolorfeedback " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` setEditColorFeedbackChkBox;
-
- $cmd = ($jasperCommand + " -q -setdisplaycvs " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` setEditDisplayCVsChkBox;
- }
- }
-
-
- global proc updateBrushFeedback(
- string $jasperCommand
- )
- {
- $cmd = ($jasperCommand + " -q -outline `currentCtx`");
- if ( `eval $cmd` ) {
- $cmd = ($jasperCommand + " -q -brushfeedback `currentCtx`");
- checkBoxGrp -e -v1 `eval $cmd` -en true brushFeedbackChkBox;
-
- $cmd = ($jasperCommand + " -q -outlinepaint `currentCtx`");
- checkBoxGrp -e -v1 `eval $cmd` -en true drawOutlinePaintingChkBox;
- }
- else {
- $cmd = ($jasperCommand + " -q -brushfeedback `currentCtx`");
- checkBoxGrp -e -v1 `eval $cmd` -en false brushFeedbackChkBox;
-
- $cmd = ($jasperCommand + " -q -outlinepaint `currentCtx`");
- checkBoxGrp -e -v1 `eval $cmd` -en false drawOutlinePaintingChkBox;
- }
- }
-
-
- proc jasperMiscValues(
- string $jasperCommand,
- string $toolName,
- int $force
- )
- {
- string $cmd;
- global int $jasperMiscActive;
-
- // print ("jasperMiscValues( " + $force + ") active = "
- // + $jasperMiscActive + "\n");
-
- if ( !$force && $jasperMiscActive ) { return; }
- $jasperMiscActive = 1;
-
- //
- // Multiple Surface Detection frameLayout
- //
- $cmd = ($jasperCommand + " -q -multisurface " + $toolName);
- string $value = `eval $cmd`;
- if ( $value == "infinite" ) {
- radioButtonGrp -e -sl 1 multiSurfaceRadio;
- }
- else if ( $value == "finite" ) {
- radioButtonGrp -e -sl 2 multiSurfaceRadio;
- }
-
- $cmd = ($jasperCommand + " -q -multisurfacesize " + $toolName);
- intSliderGrp -e -v `eval $cmd` multiSurfaceSizeSlider;
-
-
- $cmd = ($jasperCommand + " -q -multisurfacemode " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` multiSurfaceModeChkBox;
-
- // display the slider only if -multisurface = "finite"
- updateMultiSurfaceSizeSlider( $jasperCommand );
- updateMultiSurfaceModeChkBox( $jasperCommand );
-
-
- //
- // Stamp Compensation frameLayout
- //
- $cmd = ($jasperCommand + " -q -compensate " + $toolName);
- string $compensate = `eval $cmd`;
- if ( $compensate == "none" ) {
- radioButtonGrp -e -sl 1 comp0Radio;
- text -e -l "% of surf" radiusUnits;
- text -e -l "% of surf" lowerRadiusUnits;
- } else {
- text -e -l `currentUnit -q -l` radiusUnits;
- text -e -l `currentUnit -q -l` lowerRadiusUnits;
- if ( $compensate == "linear" ) {
- radioButtonGrp -e -sl 1 comp1Radio;
- } else if ( $compensate == "grid" ) {
- radioButtonGrp -e -sl 1 comp2Radio;
- }
- }
-
- $cmd = ($jasperCommand + " -q -compgridradius " + $toolName);
- intSliderGrp -e -v `eval $cmd` compGridRadius;
-
- //
- // Paint Type frameLayout
- //
- $cmd = ($jasperCommand + " -q -painttype " + $toolName);
- string $painttype = `eval $cmd`;
-
- if ( $painttype == "projective" ) {
- radioButtonGrp -e -sl 1 paintType0Radio;
- } else {
- radioButtonGrp -e -sl 1 paintType1Radio;
- }
- updateReflectionChBox( $jasperCommand );
- updateStampCompensation( $jasperCommand );
-
- //
- // Stroke Smoothing frameLayout
- //
- $cmd = ($jasperCommand + " -q -tsmoothing " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` texSmoothChkBox;
-
- $cmd = ($jasperCommand + " -q -ssmoothing " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` screenSmoothChkBox;
-
- $cmd = ($jasperCommand + " -q -ssmoothingiters " + $toolName);
- intSliderGrp -e -v `eval $cmd` divisionSlider;
-
- //
- // Pre and Post stroke command frameLayout
- //
- $cmd = $jasperCommand + " -q -bsc " + $toolName;
- textFieldGrp -e -text `eval $cmd` preStrokeTextField;
- $cmd = $jasperCommand + " -q -asc " + $toolName;
- textFieldGrp -e -text `eval $cmd` postStrokeTextField;
- }
-
-
- // ===============================================
- // Procedures to set up environmnet correctly
- // ===============================================
- global proc updateFinite(
- string $jasperCommand
- )
- {
- $cmd = ($jasperCommand + " -q -multisurfacesize `currentCtx`" );
- intSliderGrp -e -v `eval $cmd` -en true multiSurfaceSizeSlider;
- }
-
-
- global proc updateInFinite(
- string $jasperCommand
- )
- {
- $cmd = ($jasperCommand + " -q -multisurfacesize `currentCtx`") ;
- intSliderGrp -e -v `eval $cmd` -en false multiSurfaceSizeSlider;
- }
-
-
- global proc updateMultiSurfaceSizeSlider(
- string $jasperCommand
- )
- {
- $cmd = ($jasperCommand + " -q -multisurface `currentCtx`");
- string $multiSurf = `eval $cmd`;
-
- if ( $multiSurf == "infinite" ) {
- $cmd = ($jasperCommand + " -q -multisurfacesize `currentCtx`");
- intSliderGrp -e -v `eval $cmd` -en false multiSurfaceSizeSlider;
- }
- else {
- $cmd = ($jasperCommand + " -q -multisurfacesize `currentCtx`");
- intSliderGrp -e -v `eval $cmd` -en true multiSurfaceSizeSlider;
- }
- }
-
- global proc updateReflectionChBox(
- string $jasperCommand
- )
- //
- // When projective paint is ON, grey out the reflection,
- // and make sure that reflection is OFF
- //
- {
-
- string $cmd = ($jasperCommand + " -q -painttype `currentCtx`");
- string $painttype = eval( $cmd );
- if ( $painttype == "projective" ) {
- // grey out the reflection layout
- //
- if ( `frameLayout -exists reflectionFrameL` ) {
- frameLayout -e -enable false reflectionFrameL;
- }
-
- // if reflection is on, turn it off
- //
- $cmd = ($jasperCommand + " -q -reflectpaint `currentCtx`");
- if ( eval($cmd) ) {
- eval( $jasperCommand + " -e -reflectpaint false `currentCtx`");
- }
- } else {
- if ( `frameLayout -exists reflectionFrameL` ) {
- frameLayout -e -enable true reflectionFrameL;
- }
- }
- }
-
- global proc updateStampCompensation(
- string $jasperCommand
- )
- //
- // When projective paint is ON, grey out the grid compensation
- // and if grid compensation is ON, change it into a linear one
- //
- {
- $cmd = ($jasperCommand + " -q -painttype `currentCtx`");
- string $painttype = eval( $cmd );
- if ( $painttype == "projective" ) {
- // grey out the grid compensation
- //
- string $comp = eval( $jasperCommand + " -q -compensate `currentCtx`" );
- if ( $comp == "grid" ) {
- // and switch to a linear compensation if necessary
- eval( $jasperCommand + " -e -compensate \"linear\" `currentCtx`");
- }
- radioButtonGrp -e -enable false comp2Radio;
- intSliderGrp -e -enable false compGridRadius;
- } else {
- radioButtonGrp -e -enable true comp2Radio;
- intSliderGrp -e -enable true compGridRadius;
- }
- }
-
- global proc updateMultiSurfaceModeChkBox(
- string $jasperCommand
- )
- //
- // When polys are present, turn OFF the layer mode and grey out the checkbox
- //
- {
- // display the next checkbox only when there is no polys
- //
- string $cmd = ($jasperCommand + " -q -pcs `currentCtx`");
- string $spec = eval( $cmd );
-
- if ( $spec == "nurbs" ) {
- if ( `checkBoxGrp -q -exists multiSurfaceModeChkBox` ) {
- checkBoxGrp -e -enable true multiSurfaceModeChkBox;
- }
- } else {
- eval($jasperCommand + " -e -multisurfacemode false `currentCtx`");
- if ( `checkBoxGrp -q -exists multiSurfaceModeChkBox` ) {
- checkBoxGrp -e -v1 false -enable false multiSurfaceModeChkBox;
- }
- }
- }
-
- global proc updateSeamProperties(
- string $jasperCommand
- )
- //
- // When polys are present, grey out the whole seam tab
- //
- {
- // display the following checkbox only when nurbs only
- //
- string $cmd = ($jasperCommand + " -q -pcs `currentCtx`");
- string $spec = eval( $cmd );
-
- if ( $spec == "nurbs" ) {
- if ( `frameLayout -exists brushModeLayout` ) {
- frameLayout -e -enable true brushModeLayout;
- }
- if ( `frameLayout -exists seamAutoLayout` ) {
- frameLayout -e -enable true seamAutoLayout;
- }
- if ( `frameLayout -exists commEdgeCornerLayout` ) {
- frameLayout -e -enable true commEdgeCornerLayout;
- }
- if ( `frameLayout -exists CommEdge` ) {
- frameLayout -e -enable true CommEdge;
- }
- if ( `frameLayout -exists CommCorner` ) {
- frameLayout -e -enable true CommCorner;
- }
- if ( `frameLayout -exists puttyStitchLayout` ) {
- frameLayout -e -enable true puttyStitchLayout;
- }
- if ( `frameLayout -exists valueStitchLayout` ) {
- frameLayout -e -enable true valueStitchLayout;
- }
-
- updateCommEdgeDisplayScreen( $jasperCommand );
- } else {
- if ( `frameLayout -exists brushModeLayout` ) {
- frameLayout -e -enable false brushModeLayout;
- }
- if ( `frameLayout -exists seamAutoLayout` ) {
- frameLayout -e -enable false seamAutoLayout;
- }
- if ( `frameLayout -exists commEdgeCornerLayout` ) {
- frameLayout -e -enable false commEdgeCornerLayout;
- }
- if ( `frameLayout -exists CommCorner` ) {
- frameLayout -e -enable false CommCorner;
- }
- if ( `frameLayout -exists CommEdge` ) {
- frameLayout -e -enable false CommEdge;
- }
- if ( `frameLayout -exists puttyStitchLayout` ) {
- frameLayout -e -enable false puttyStitchLayout;
- }
- if ( `frameLayout -exists valueStitchLayout` ) {
- frameLayout -e -enable false valueStitchLayout;
- }
- }
- }
-
- global proc updateUVSculptDirection(
- string $jasperCommand
- )
- //
- // When polys are present, grey out the uv directions in sculpt tool
- //
- {
- // display the next checkbox only when nurbs only
- //
- string $cmd = ($jasperCommand + " -q -pcs `currentCtx`");
- string $spec = eval( $cmd );
-
- if ( $spec == "nurbs" ) {
- radioButtonGrp -e -enable true rv2Radio;
- }
- else {
- string $cmd1 = ($jasperCommand + " -q -refvector `currentCtx`");
- string $refvec = eval( $cmd1 );
- if ( ( $refvec == "visoparm" ) || ( $refvec == "uisoparm" ) ) {
- radioButtonGrp -e -sl 1 rv0Radio;
- eval( $jasperCommand + " -e -refvector \"normal\" `currentCtx`" );
- }
- radioButtonGrp -e -enable false rv2Radio;
- }
- }
- // ==================================================
- // End of procedures to set up environmnet correctly
- // ==================================================
-
-
- // these globals are used to keep track of script jobs
- //
- global int $jasperScriptJob = -1;
- global int $jasperToolChangedJob = -1;
- global int $jasperReaperJob = -1;
-
-
- // these flags indicate whether the specified tab has been shown
- // while the current context has been active
- //
- global int $jasperSculptActive = 0;
- global int $jasperWeightActive = 0;
- global int $jasperSelectActive = 0;
- global int $jasperSetEditActive = 0;
- global int $jasperStampActive = 0;
- global int $jasperStrokeActive = 0;
- global int $jasperSeamActive = 0;
- global int $jasperMaskActive = 0;
- global int $jasperMapActive = 0;
- global int $jasperDisplayActive = 0;
- global int $jasperMiscActive = 0;
- global int $jasperSetupActive = 0;
- global int $jasperAttrActive = 0;
-
-
- // string that indicates which tool context we think we're in
- //
- global string $jasperCurContext;
-
- // jasperUnitsChanged is called when current linear units have
- // changed
- // - it assumes that Maya is currently in a Jasper tool
- //
- global proc jasperUnitsChanged(
- string $parent,
- string $jasperCommand
- )
- {
- global int $jasperStampActive;
- global int $jasperSculptActive;
- global int $jasperShellActive;
-
- string $cmd;
- string $cc = `currentCtx`;
- string $cu = `currentUnit -q -l`;
-
- setParent $parent;
-
- if ( $jasperStampActive ) {
- // Only change radius units if we are in a compensated mode.
- //
- $cmd = ($jasperCommand + " -q -compensate " + $cc);
- string $compensate = `eval $cmd`;
- if ( $compensate != "none" ) {
- // update radius units and radius slider
- //
- text -e -l $cu radiusUnits;
- text -e -l $cu lowerRadiusUnits;
- $cmd = ($jasperCommand + " -q -radius " + $cc);
- floatSliderGrp -e -v `eval $cmd` radius;
- $cmd = ($jasperCommand + " -q -lowerradius " + $cc);
- floatSliderGrp -e -v `eval $cmd` lowerRadius;
- }
- }
-
- // if this dialog contains sculpt tab, update the max
- // displacement slider and it's unit label
- //
- if ( $jasperSculptActive ) {
- text -e -l $cu maxDispUnits;
- $cmd = ($jasperCommand + " -q -maxdisp " + $cc);
- floatSliderGrp -e -v `eval $cmd` maxDisp;
- }
-
- // if this dialog contains shell tab, update the tolerance
- // slider and it's unit label
- //
- if ( $jasperShellActive ) {
- text -e -l $cu commEdgesTolUnits;
- $cmd = ($jasperCommand + " -q -commedgetol " + $cc);
- floatSliderGrp -e -v `eval $cmd` commEdgesTol;
-
- text -e -l $cu collapseCVTolUnits;
- $cmd = ($jasperCommand + " -q -collapsecvtol " + $cc);
- floatSliderGrp -e -v `eval $cmd` collapseCVTol;
- }
-
- // tell the context to update the status line
- //
- eval ($jasperCommand + " -e -usl " + $cc);
- }
-
- proc resetJasperActiveFlags()
- {
- global int $jasperSculptActive;
- global int $jasperWeightActive;
- global int $jasperSelectActive;
- global int $jasperSetEditActive;
- global int $jasperStampActive;
- global int $jasperStrokeActive;
- global int $jasperSeamActive;
- global int $jasperMaskActive;
- global int $jasperMapActive;
- global int $jasperDisplayActive;
- global int $jasperMiscActive;
- global int $jasperSetupActive;
- global int $jasperAttrActive;
-
- $jasperSculptActive = 0;
- $jasperWeightActive = 0;
- $jasperSelectActive = 0;
- $jasperSetEditActive = 0;
- $jasperStampActive = 0;
- $jasperStrokeActive = 0;
- $jasperSeamActive = 0;
- $jasperMaskActive = 0;
- $jasperMapActive = 0;
- $jasperDisplayActive = 0;
- $jasperMiscActive = 0;
- $jasperSetupActive = 0;
- $jasperAttrActive = 0;
- }
-
- // This is called to reset all the stuff related to active
- // flags for all the various tabs that are contained in Jasper
- // UI dialogs. It also kills the script job that was setup to
- // update the UI when the current units change.
- //
- proc resetJasperTool(
- int $deleteSetWindow
- )
- {
- // print ("in resetJasperTool()\n");
-
- global int $jasperScriptJob;
- global string $jasperCurContext;
-
- if ( $jasperScriptJob != -1 ) {
- scriptJob -force -kill $jasperScriptJob;
- $jasperScriptJob = -1;
- }
-
- resetJasperActiveFlags();
- $jasperCurContext = "";
- }
-
-
- global proc jasperToolChanged(
- int $fromToolChangedScriptJob
- )
- {
- global int $jasperToolChangedJob;
- global int $jasperReaperJob;
- global string $jasperCurContext;
-
- resetJasperTool( $fromToolChangedScriptJob );
-
- // if we weren't called from the tool changed script job
- // we have to kill it ourselves
- //
- if ( ! $fromToolChangedScriptJob && $jasperToolChangedJob != -1 ) {
- scriptJob -force -kill $jasperToolChangedJob;
- }
- $jasperToolChangedJob = -1;
-
- // we also kill the reaper script job if it's there
- //
- if ( $jasperReaperJob != -1 ) {
- scriptJob -force -kill $jasperReaperJob;
- $jasperReaperJob = -1;
- }
- }
-
-
- global proc jasperUIDeleted()
- {
- // print ("in jasperUIDeleted()\n");
-
- global int $jasperToolChangedJob;
- global int $jasperReaperJob;
-
- resetJasperTool( 0 );
-
- // if the tool changed script job is running, we have to kill it
- //
- if ( $jasperToolChangedJob != -1 ) {
- scriptJob -force -kill $jasperToolChangedJob;
- $jasperToolChangedJob = -1;
- }
-
- // since this was called from the script job, we assume the
- // script job will be killed after this.
- //
- $jasperReaperJob = -1;
- }
-
-
- proc doJasperValues(
- string $jasperCmd,
- string $toolName,
- string $currentTab,
- int $force
- )
- {
- // print ("in doJasperValues: parent = " + `setParent -q` + "\n");
-
- // create a couple of script jobs that will handle changes in
- // the current radius units
- //
- global int $jasperScriptJob;
- global int $jasperToolChangedJob;
- global int $jasperReaperJob;
- global string $jasperCurContext;
- int $startScriptJobs;
-
- if ( $jasperScriptJob == -1 ) {
- $startScriptJobs = 1;
- } else {
- // A script job is running. Check if the current context
- // and the one we think we're in don't match, if so we must
- // have switched from one Jasper tool to another. Call
- // resetJasperTool() to reset everything
- //
- if ( $toolName != $jasperCurContext ) {
- jasperToolChanged( 0 );
- $startScriptJobs = 1;
- } else {
- $startScriptJobs = 0;
- }
- }
-
- if ( $startScriptJobs ) {
- string $parent = `setParent -q`;
-
- $jasperScriptJob = `scriptJob -protected -event "linearUnitChanged"
- ("jasperUnitsChanged " + $parent + " " + $jasperCmd + ";")`;
-
- // Create another script job which will kill the previous
- // one when a tool change happens. This is only run once,
- // so it will be destroyed when it is triggered
- //
- if ( $jasperToolChangedJob == -1 ) {
- $jasperToolChangedJob = `scriptJob -runOnce true
- -event "ToolChanged" "jasperToolChanged( 1 )"`;
- }
- $jasperCurContext = $toolName;
-
- // create another script that gets called if the parent
- // gets destroyed. It will get rid of the other two jobs.
- // This one will only get run once.
- //
- if ( $jasperReaperJob == -1 ) {
- $jasperReaperJob =
- `scriptJob -protected -uiDeleted $parent "jasperUIDeleted()"`;
- }
- }
-
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- if( $currentTab == "Sculpt" ) {
- jasperSculptValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "Script_Paint" )
- {
- jasperValueValues( $jasperCmd, $toolName, $currentTool, $force, false, "" );
- }
- // OBSOLETE
- /*
- if ( $currentTab == "Paint" ) {
- paintColorTabValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "File_Textures" ) {
- paintColorFileValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "Select" ) {
- jasperSelectValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- */
- else if( $currentTab == "SetMembership" ) {
- jasperSetEditValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "Stroke" ) {
- jasperStrokeValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "Seam" ) {
- jasperSeamValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "Mask" ) {
- jasperMaskValues( $jasperCmd, $toolName, $force );
- }
- else if( $currentTab == "Map" ) {
- jasperMapValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- else if( $currentTab == "Display" ) {
- if ( $currentTool == "paintColor" ) {
- paintColorDisplayValues( $jasperCmd, $toolName, $force );
- } else {
- jasperDisplayValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- }
- else if( $currentTab == "Misc" ) {
- if ( $currentTool == "paintColor" ) {
- paintColorMiscValues( $jasperCmd, $toolName, $force );
- } else {
- jasperMiscValues( $jasperCmd, $toolName, $force );
- }
- }
- else if( $currentTab == "Setup" ) {
- jasperSetupValues( $jasperCmd, $toolName, $force );
- }
- /*
- else if( $currentTab == "Attr" ) {
- jasperAttrValues( $jasperCmd, $toolName, $currentTool, $force );
- }
- */
- else {
- attrPaintInstValueDefine(
- $jasperCmd, $toolName, $currentTool, $force, $currentTab
- );
- }
- if( $jasperCmd == "attrPaintCtx" ) {
- attrPaintInstCustomizeUI(
- $jasperCmd, $toolName, $currentTool, $force, $currentTab
- );
- }
- }
-
-
- global proc jasperValues(
- string $jasperCommand,
- string $toolName,
- string $currentTab
- )
- {
- source "jasperCallback.mel";
-
- // print "in jasperValues\n";
- resetJasperActiveFlags();
- doJasperValues( $jasperCommand, $toolName, $currentTab, 1 );
- }
-
-
- global proc updateJasperValues(
- string $jasperCommand,
- string $toolName,
- string $currentTab
- )
- {
- // print "in updateJasperValues\n";
- doJasperValues( $jasperCommand, $toolName, $currentTab, 0 );
- }
-
-
-